import request from '@/config/axios'

export interface WeDeptVO {
        id: number
        weDeptId: number
        weDeptName: string
        weDeptLeader: string
        sort: number
        parentId: number
}

// 查询企微部门列表
export const getWeDeptPage = async (params) => {
    return await request.get({url: `/wecom/we-dept/page`, params})
}

// 查询企微部门详情
export const getWeDept = async (id: number) => {
    return await request.get({url: `/wecom/we-dept/get?id=` + id})
}

// 新增企微部门
export const createWeDept = async (data: WeDeptVO) => {
    return await request.post({url: `/wecom/we-dept/create`, data})
}

// 修改企微部门
export const updateWeDept = async (data: WeDeptVO) => {
    return await request.put({url: `/wecom/we-dept/update`, data})
}

// 删除企微部门
export const deleteWeDept = async (id: number) => {
    return await request.delete({url: `/wecom/we-dept/delete?id=` + id})
}

// 导出企微部门 Excel
export const exportWeDept = async (params) => {
    return await request.download({url: `/wecom/we-dept/export-excel`, params})
}